package com.kly.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kly.springbootinit.model.dto.vehicle.VehicleQueryRequest;
import com.kly.springbootinit.model.dto.vehicle.VehicleRentRequest;
import com.kly.springbootinit.model.entity.Vehicle;
import com.kly.springbootinit.model.vo.VehicleVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 车辆管理服务
 *
 * @author <a href="https://github.com/likly">程序员鹿七</a>
 * @from <a href="https://www.code-nav.cn">编程导航学习圈</a>
 */
public interface VehicleService extends IService<Vehicle> {

    /**
     * 校验数据
     *
     * @param vehicle
     * @param add 对创建的数据进行校验
     */
    void validVehicle(Vehicle vehicle, boolean add);

    /**
     * 获取查询条件
     *
     * @param vehicleQueryRequest
     * @return
     */
    QueryWrapper<Vehicle> getQueryWrapper(VehicleQueryRequest vehicleQueryRequest);
    
    /**
     * 获取车辆管理封装
     *
     * @param vehicle
     * @param request
     * @return
     */
    VehicleVO getVehicleVO(Vehicle vehicle, HttpServletRequest request);

    /**
     * 分页获取车辆管理封装
     *
     * @param vehiclePage
     * @param request
     * @return
     */
    Page<VehicleVO> getVehicleVOPage(Page<Vehicle> vehiclePage, HttpServletRequest request);

}
